package api

import (
	"github.com/gin-gonic/gin"
)

type API struct {
	Router *gin.Engine
}

func NewAPI() *API {
	api := &API{
		Router: gin.Default(),
	}
	// 注册所有接口
	api.setupRoutes()
	return api
}

func (api *API) setupRoutes() {
	//api.Router.POST("/savedata", SaveData)
	api.Router.GET("/expressageList", getExpressageData)
	api.Router.GET("/getuser", getUserInfo)
	api.Router.POST("/login", userLogin)
	api.Router.POST("/register", registerUser)
	api.Router.POST("/saveData", SaveData)
}
